gtk4.git
5 years agogtk/treeview: Position editable widgets correctly wrt left border
Carlos Garnacho [Fri, 11 Dec 2020 16:56:14 +0000 (17:56 +0100)]
gtk/treeview: Position editable widgets correctly wrt left border

The coordinates are already widget-local here, not transformed by the
adjustment positions. Using the adjustment value here ends up pushing
the entry far from the left border.

The correct minimum value here is 0, which matches the treeview left
border.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3009
5 years agogtk/modelbutton: Handle unpaired releases
Carlos Garnacho [Fri, 11 Dec 2020 15:59:07 +0000 (16:59 +0100)]
gtk/modelbutton: Handle unpaired releases

Let model buttons handle unpaired releases, these may happen indirectly
e.g. due to other child menus being opened at the time. Clicking would
dismiss the menu, but the menu item beneath the pointer would not get
activated.

We can handle that button release though via ::unpaired-release, so
there's no second click required.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3463
5 years agogtk/range: Move button release handling to GtkGestureDrag
Carlos Garnacho [Fri, 11 Dec 2020 15:22:26 +0000 (16:22 +0100)]
gtk/range: Move button release handling to GtkGestureDrag

Tracking it through the GtkGestureClick becomes a bit cumbersome for
handling of simultaneously pressed buttons. We can track ::stopped,
but that also emits for a number of situations where we want drag to
continue.

However, the GtkGestureDrag is grouped with the click gesture, and
knows better when to finish the drag gesture (not just because of a
button release), so hook drag and zoom mode finalization there.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3426
5 years agoMerge branch 'ebassi/for-master' into 'master'
Emmanuele Bassi [Sat, 12 Dec 2020 00:01:38 +0000 (00:01 +0000)]
Merge branch 'ebassi/for-master' into 'master'

Ebassi/for master

See merge request GNOME/gtk!2944

5 years agoUpdate CODEOWNERS
Emmanuele Bassi [Fri, 11 Dec 2020 23:42:25 +0000 (23:42 +0000)]
Update CODEOWNERS

Add me as the reference for the accessibility bits of the code base.

5 years agodocs: Fix the Widget as Buildable example
Emmanuele Bassi [Fri, 11 Dec 2020 23:41:51 +0000 (23:41 +0000)]
docs: Fix the Widget as Buildable example

The layout properties use an old name.

5 years agoUpdate Norwegian Bokmål translation
Kjartan Maraas [Fri, 11 Dec 2020 11:40:55 +0000 (11:40 +0000)]
Update Norwegian Bokmål translation

5 years agoUpdate Romanian translation
Florentina Mușat [Thu, 10 Dec 2020 15:34:51 +0000 (15:34 +0000)]
Update Romanian translation

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Thu, 10 Dec 2020 14:31:54 +0000 (14:31 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

docs: Update references to GtkWindow:fullscreened

See merge request GNOME/gtk!2943

5 years agodocs: Update references to GtkWindow:fullscreened
Matthias Clasen [Thu, 10 Dec 2020 14:10:21 +0000 (09:10 -0500)]
docs: Update references to GtkWindow:fullscreened

The property got renamed from fullscreen to fullscreened.
Update all references.

5 years agoUpdate Swedish translation
Luna Jernberg [Wed, 9 Dec 2020 21:05:25 +0000 (21:05 +0000)]
Update Swedish translation

5 years agoMerge branch 'ebassi/popcount' into 'master'
Matthias Clasen [Wed, 9 Dec 2020 16:32:09 +0000 (16:32 +0000)]
Merge branch 'ebassi/popcount' into 'master'

Share the popcount() fallback for MSVC

See merge request GNOME/gtk!2940

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Wed, 9 Dec 2020 16:10:04 +0000 (16:10 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Remove NoDisplay from demo desktop files

Closes #2932

See merge request GNOME/gtk!2939

5 years agoShare the popcount() fallback for MSVC
Emmanuele Bassi [Wed, 9 Dec 2020 15:48:09 +0000 (15:48 +0000)]
Share the popcount() fallback for MSVC

We use __builtin_popcount() in a couple of places, so it makes sense to
have it in one header.

5 years agowidget-factory: Autoplay the video
Matthias Clasen [Wed, 9 Dec 2020 15:52:55 +0000 (10:52 -0500)]
widget-factory: Autoplay the video

The empty video on the frontpage is a bit of a letdown, since
the big arrow can't be clicked.

5 years agoRemove NoDisplay from demo desktop files
Matthias Clasen [Wed, 9 Dec 2020 15:05:54 +0000 (10:05 -0500)]
Remove NoDisplay from demo desktop files

When these are installed (in particular, as flatpaks),
we should not hide them.

Fixes: #2932
5 years agoMerge branch 'wip/carlosg/for-master' into 'master'
Matthias Clasen [Wed, 9 Dec 2020 15:04:01 +0000 (15:04 +0000)]
Merge branch 'wip/carlosg/for-master' into 'master'

Wip/carlosg/for master

Closes #3426 and #3264

See merge request GNOME/gtk!2933

5 years agoMerge branch 'wip/jimmac/row-transitions-and-spacing' into 'master'
Matthias Clasen [Wed, 9 Dec 2020 13:35:54 +0000 (13:35 +0000)]
Merge branch 'wip/jimmac/row-transitions-and-spacing' into 'master'

Adwaita: row transitions and spacing

Closes #3434

See merge request GNOME/gtk!2937

5 years agoMerge branch 'wip/baedert/for-master' into 'master'
Matthias Clasen [Wed, 9 Dec 2020 13:34:21 +0000 (13:34 +0000)]
Merge branch 'wip/baedert/for-master' into 'master'

Wip/baedert/for master

Closes #3431

See merge request GNOME/gtk!2938

5 years agoMerge branch 'ebassi/4-0-abi-bump' into 'master'
Matthias Clasen [Wed, 9 Dec 2020 13:20:20 +0000 (13:20 +0000)]
Merge branch 'ebassi/4-0-abi-bump' into 'master'

Ebassi/4 0 abi bump

Closes #3392

See merge request GNOME/gtk!2883

5 years agobuild: Bump up the SONAME for GTK4
Emmanuele Bassi [Mon, 23 Nov 2020 18:02:12 +0000 (18:02 +0000)]
build: Bump up the SONAME for GTK4

We released all the 3.9x development snapshots using:

  libgtk-4.0.so.0.xxxx.y

which means that the 4.0.0 release of GTK will have a lower SONAME than
the snapshots. To avoid that, bump the SONAME to 1.xxxx.y.

Fixes: #3392
5 years agobuild: Tie interface age to the development cycle
Emmanuele Bassi [Mon, 23 Nov 2020 17:58:43 +0000 (17:58 +0000)]
build: Tie interface age to the development cycle

We don't want to increase the interface age manually, because we're
going to end up forgetting about it.

Instead, we should tie it to the rest of the version:

 - in stable (even minor) cycles, we don't add new API; the interface
   age is the same as the micro version
 - in unstable (odd minor) cycles, every new release might have new API,
   or updates to newly added API; keep the interface age to 0

This removes one more manual thing to change during release, and keeps
us honest with our promise not to add symbols during stable cycles.

5 years agoPrepare version macros for 4.0
Emmanuele Bassi [Tue, 8 Dec 2020 17:37:46 +0000 (17:37 +0000)]
Prepare version macros for 4.0

Remove the 3.9x version macros, and ensure that we handle 4.0 as the
backstop for the minimum required version.

5 years agoAdwaita: row transitions and spacing
Jakub Steiner [Wed, 9 Dec 2020 10:52:49 +0000 (11:52 +0100)]
Adwaita: row transitions and spacing

- no fading out of row hovers. Many feel like it's a slow
  refresh rather than intentional effect.
- give some margin to navigation lists

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3434

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Wed, 9 Dec 2020 07:08:51 +0000 (07:08 +0000)]
Update Ukrainian translation

5 years agoMerge branch 'ebassi/prop-names' into 'master'
Matthias Clasen [Wed, 9 Dec 2020 05:51:00 +0000 (05:51 +0000)]
Merge branch 'ebassi/prop-names' into 'master'

Ebassi/prop names

See merge request GNOME/gtk!2936

5 years agoMerge branch 'sophie-h-master-patch-62064' into 'master'
Matthias Clasen [Wed, 9 Dec 2020 00:53:10 +0000 (00:53 +0000)]
Merge branch 'sophie-h-master-patch-62064' into 'master'

gtk-demo: Remove potentially ableist metaphor

See merge request GNOME/gtk!2934

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Wed, 9 Dec 2020 00:52:53 +0000 (00:52 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #3451

See merge request GNOME/gtk!2935

5 years agoRename GtkWindow:fullscreen to :fullscreened
Emmanuele Bassi [Wed, 9 Dec 2020 00:11:49 +0000 (00:11 +0000)]
Rename GtkWindow:fullscreen to :fullscreened

Having a property with the same name of a method makes some languages
which put properties and method names in the same flat namespace not
really happy about our choices. To avoid collisions, let's put the the
"fullscreen" property into the past, alongside the "maximized" property.

5 years agoFix the documentation for GtkWindow state properties
Emmanuele Bassi [Tue, 8 Dec 2020 23:49:45 +0000 (23:49 +0000)]
Fix the documentation for GtkWindow state properties

Drop the "don't write code that crashes" folksy bit; don't start
sentences with conjunctions; remove copy-pasted references to
"iconified" states; point to the corresponding property notification in
a consistent manner.

5 years agoMark flaky tests as flaky
Matthias Clasen [Tue, 8 Dec 2020 22:50:14 +0000 (17:50 -0500)]
Mark flaky tests as flaky

We can't mark these as xfail, since it sometimes succeed.

5 years agogtk-demo: Remove potentially ableist metaphor
Sophie Herold [Tue, 8 Dec 2020 23:02:03 +0000 (23:02 +0000)]
gtk-demo: Remove potentially ableist metaphor

5 years agoAdd bug reporting address to pot files
Matthias Clasen [Sun, 6 Dec 2020 16:00:35 +0000 (11:00 -0500)]
Add bug reporting address to pot files

Fixes: #3451
5 years agogtk/main: Keep implicit grab until all buttons are released
Carlos Garnacho [Tue, 8 Dec 2020 22:13:50 +0000 (23:13 +0100)]
gtk/main: Keep implicit grab until all buttons are released

Currently, the implicit grab is broken on the first button release,
in the case of pressing multiple buttons simultaneously. This means
that we emit crossing events early, and the next button releases
are sent to the pointer focus widget instead.

Consider the implicit grab effective until all buttons are released,
and only unset the pointer implicit grab (and emit crossing events)
after there are no further buttons pressed. We do this by checking
event modifiers, given button release events do contain the modifiers
in effect at the time the event was generated, we have to look for
exactly one active button modifier.

Fixes weird pointer states after pressing multiple buttons on a
widget.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3426
5 years agogdk/surface: Delay gdk_surface_request_motion() requests internally
Carlos Garnacho [Tue, 8 Dec 2020 20:33:06 +0000 (21:33 +0100)]
gdk/surface: Delay gdk_surface_request_motion() requests internally

Those requests are received while dealing with the ::layout frame
clock phase, this has the unintended side effect of making the
frame clock "rewind" to handle ::flush-events again during this
frame, which delays everything and practically halves the frame
rate.

We do intend to make the motion events dispatches on the next frame,
so do this in an idle at a slightly lower priority than layout/draw,
so the ::flush-events phase is actually requested for the next frame.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3264
5 years agogkt/textview: Set an iter position for event-less menu activation
Carlos Garnacho [Tue, 8 Dec 2020 13:45:16 +0000 (14:45 +0100)]
gkt/textview: Set an iter position for event-less menu activation

This went missing. Use the current insertion position as a reference.
Fixes invoking the menu via keyboard.

5 years agoMerge branch 'wip/chergert/gdk-macos-for-master' into 'master'
Matthias Clasen [Tue, 8 Dec 2020 20:32:51 +0000 (20:32 +0000)]
Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'

macos: fix macOS build breakage

See merge request GNOME/gtk!2931

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Tue, 8 Dec 2020 20:25:26 +0000 (20:25 +0000)]
Update Ukrainian translation

5 years agoUpdate Romanian translation
Florentina Mușat [Tue, 8 Dec 2020 19:52:12 +0000 (19:52 +0000)]
Update Romanian translation

5 years agomacos: fix macOS build breakage
Christian Hergert [Tue, 8 Dec 2020 19:29:31 +0000 (11:29 -0800)]
macos: fix macOS build breakage

Fixes breakages due to recent refactoring around sizing changes.

5 years agoMark the window-show-contents-on-map.ui reftest as xfail
Matthias Clasen [Tue, 8 Dec 2020 17:04:47 +0000 (12:04 -0500)]
Mark the window-show-contents-on-map.ui reftest as xfail

We know now what the test is trying to test, just lack
the right plumbing to do it properly. So, keep the test
around, marked as expected fail.

5 years agoRevert "reftests: Remove window-show-contents-on-map.ui test"
Matthias Clasen [Tue, 8 Dec 2020 16:45:52 +0000 (11:45 -0500)]
Revert "reftests: Remove window-show-contents-on-map.ui test"

This reverts commit 074b933ae4e866d092edd734fd43524e39033b5e.

5 years ago3.99.5
Matthias Clasen [Tue, 8 Dec 2020 15:57:27 +0000 (10:57 -0500)]
3.99.5

5 years agodocs: Remove a mention of gtk_window_get_size
Matthias Clasen [Tue, 8 Dec 2020 15:44:33 +0000 (10:44 -0500)]
docs: Remove a mention of gtk_window_get_size

That function has been removed.

5 years agoMerge branch 'wip/surface-state-rework' into 'master'
Matthias Clasen [Tue, 8 Dec 2020 15:38:36 +0000 (15:38 +0000)]
Merge branch 'wip/surface-state-rework' into 'master'

Rework surface state and geometry computation

See merge request GNOME/gtk!2885

5 years agoMerge branch 'wip/jimmac/no-inner-shadow-sidebars' into 'master'
Jakub Steiner [Tue, 8 Dec 2020 14:18:44 +0000 (14:18 +0000)]
Merge branch 'wip/jimmac/no-inner-shadow-sidebars' into 'master'

Adwaita: no 3d shadow for pressed sidebar

Closes #3413

See merge request GNOME/gtk!2928

5 years agoreftests: Remove window-show-contents-on-map.ui test
Jonas Ådahl [Tue, 8 Dec 2020 13:22:59 +0000 (14:22 +0100)]
reftests: Remove window-show-contents-on-map.ui test

It tested that a widget shown after the window was mapped deals with
window resizing appropriately when doing the follow-up allocation. Now,
doing this only allocates both at the same time, as allocation happens
during the frame dispatch.

To do the equivalent now, one would have to write code that shows the
label after the first frame was drawn, and that's not possible via a
reftest, so lets remove it.

5 years agoreftests/textview-tags: Hide text view cursor
Jonas Ådahl [Tue, 8 Dec 2020 11:03:18 +0000 (12:03 +0100)]
reftests/textview-tags: Hide text view cursor

Otherwise it'd sometimes show up, causing test flakyness.

5 years agoMerge branch 'wip/chergert/gdk-macos-for-master' into 'master'
Matthias Clasen [Tue, 8 Dec 2020 00:06:19 +0000 (00:06 +0000)]
Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'

macos: various GL context cleanups

See merge request GNOME/gtk!2929

5 years agotestsuite/notify: Don't fiddle with GtkWidget::visible
Jonas Ådahl [Mon, 7 Dec 2020 21:41:36 +0000 (22:41 +0100)]
testsuite/notify: Don't fiddle with GtkWidget::visible

It may map toplevel windows with arbitrary modes, which will effect
other properties, such as GtkWindow::maximized and
GtkWindow::fullscreen.

5 years agotestsuite/filtermodel: Remove calls to gtk_widget_realize()
Jonas Ådahl [Mon, 7 Dec 2020 21:29:51 +0000 (22:29 +0100)]
testsuite/filtermodel: Remove calls to gtk_widget_realize()

They don't do what they used to do.

5 years agomacos: use CGLSetParameter and CGLEnable
Christian Hergert [Mon, 7 Dec 2020 19:47:51 +0000 (11:47 -0800)]
macos: use CGLSetParameter and CGLEnable

We don't need to go through the NSOpenGLContext for these.
We can just use the C API directly. It's also clearer what is using
CGLEnable() vs CGLSetParameter().

5 years agogdk: Replace 'WITHDRAWN' state with async 'is-mapped' boolean
Jonas Ådahl [Mon, 7 Dec 2020 17:18:38 +0000 (18:18 +0100)]
gdk: Replace 'WITHDRAWN' state with async 'is-mapped' boolean

It was used by all surfaces to track 'is-mapped', but still part of the
GdkToplevelState, and is now replaced with a separate boolean in the
GdkSurface structure.

It also caused issues when a widget was unmapped, and due to that
unmapped a popover which hid its corresponding surface. When this
surface was hidden, it emitted a state change event, which would then go
back into GTK and queue a resize on popover widget, which would travel
back down to the widget that was originally unmapped, causing confusino
when doing future allocations.

To summarize, one should not hide widgets during allocation, and to
avoid this, make this new is-mapped boolean asynchronous when hiding a
surface, meaning the notification event for the changed mapped state
will be emitted in an idle callback. This avoids the above described
reentry issue.

5 years agogtk/headerbar: Remove unused 'state' field
Jonas Ådahl [Mon, 7 Dec 2020 15:04:01 +0000 (16:04 +0100)]
gtk/headerbar: Remove unused 'state' field

5 years agoMention window sizes in the migration guide
Matthias Clasen [Sat, 5 Dec 2020 17:41:52 +0000 (12:41 -0500)]
Mention window sizes in the migration guide

5 years agodocs: Add gtk_window_is_fullscreen
Matthias Clasen [Sat, 5 Dec 2020 17:29:17 +0000 (12:29 -0500)]
docs: Add gtk_window_is_fullscreen

5 years agopopup: Documentation tweaks
Matthias Clasen [Sat, 5 Dec 2020 17:28:50 +0000 (12:28 -0500)]
popup: Documentation tweaks

Use proper syntax for referring to signals.

5 years agoProperly remove gtk_window_get_size
Matthias Clasen [Sat, 5 Dec 2020 17:15:24 +0000 (12:15 -0500)]
Properly remove gtk_window_get_size

It was still in the headers and the docs, but did
not have an implementation anymore.

5 years agotests/animated-resizing: Use gtk_window_default_size() instead
Jonas Ådahl [Mon, 7 Dec 2020 08:41:54 +0000 (09:41 +0100)]
tests/animated-resizing: Use gtk_window_default_size() instead

This will actually make it resize on-demand, as the default size is the
size used when computing the window size when the size is not fixed.

5 years agowayland/toplevel: Don't alwyas skip changing xdg_toplevel state
Jonas Ådahl [Sat, 5 Dec 2020 14:57:45 +0000 (15:57 +0100)]
wayland/toplevel: Don't alwyas skip changing xdg_toplevel state

We only called xdg_toplevel.(un)set_maximize() if the toplevel layout
changed, but this misses the case when the compositor had changed the
maximized state. Change it to call the xdg_toplevel request if either
the local layout changed, or if the layout differs from the current
state.

This fixes an issue where one couldn't unmaximize a window by double
clicking the titlebar that, had previously been maximized e.g. using a
keyboard binding.

Do the same for fullscreen.

5 years agogtk/window: Add 'fullscreen' prop and gtk_window_is_fullscreen()
Jonas Ådahl [Sat, 5 Dec 2020 11:22:25 +0000 (12:22 +0100)]
gtk/window: Add 'fullscreen' prop and gtk_window_is_fullscreen()

This makes it possible to set 'fullscreen' to 'true' in a .ui file to
start an application in fullscreen mode.

5 years agogtk/window: Make R/O is-maximized R/W maximized prop
Jonas Ådahl [Sat, 5 Dec 2020 11:11:25 +0000 (12:11 +0100)]
gtk/window: Make R/O is-maximized R/W maximized prop

This makes it possible to set 'maximized' to true in .ui files, and the
window will show up maximized.

gtk_window_is_maximized() will return the intended maximized state until
actually mapped, it will then show the actual maximized state. The same
applies to reading the property.

5 years agogtk/window: Make 'default-size' adapt to configured size
Jonas Ådahl [Sat, 5 Dec 2020 10:44:51 +0000 (11:44 +0100)]
gtk/window: Make 'default-size' adapt to configured size

This commit changes the behavior of window size computation and the
default size properties to:

 * The default-width and default-height properties are updated to the
   current window size unless the size is fixed by e.g. being maxmized,
   tiled etc.
 * The compute-size semantics are to just pick the default size, or if
   not adequate, use the measured size, and consequently update the
   default size, unless unresizable.
 * gtk_window_get_size() is removed, what's more likely relevant is the
   gtk_window_get_default_size() which will now contain more sensible
   values.

Various places that used gtk_window_get_size() were updated to use
gtk_window_get_default_size() to remember and restore previous sizes.

This also changes the default value of 'default-width' and
'default-height' from -1 to 0. The gtk builder simplify tool is taught
how to omit when the default size is set to both -1 and 0.

5 years agox11/surface: Avoid resizing if computed size didn't change
Jonas Ådahl [Sat, 5 Dec 2020 10:40:47 +0000 (11:40 +0100)]
x11/surface: Avoid resizing if computed size didn't change

This fixes an issue where we'd resize to the previous window size during
interactive resize.

5 years agox11/surface: Move the scattered compute-size calls to helper
Jonas Ådahl [Sat, 5 Dec 2020 10:38:17 +0000 (11:38 +0100)]
x11/surface: Move the scattered compute-size calls to helper

This simplifies things, and fixes issue where we'd resize the wrong
time, and miss resizing other times.

5 years agox11/surface: Remember the toplevel layout
Jonas Ådahl [Sat, 5 Dec 2020 10:30:45 +0000 (11:30 +0100)]
x11/surface: Remember the toplevel layout

5 years agox11/surface: Compute size after update too
Jonas Ådahl [Sat, 5 Dec 2020 10:13:07 +0000 (11:13 +0100)]
x11/surface: Compute size after update too

This will sometimes mean a frame is skipped if a resize was requested
during the update phase of the frame dispatch. Not doing so can cause
trying to allocate a window smaller than the minimum size of the widget.

5 years agox11/surface: Remember when there is a pending ConfigureNotify
Jonas Ådahl [Sat, 5 Dec 2020 10:02:58 +0000 (11:02 +0100)]
x11/surface: Remember when there is a pending ConfigureNotify

This will be used to decide whether to try to resize windows when .

5 years agogdk/surface: Allow inhibit layout from backend
Jonas Ådahl [Fri, 4 Dec 2020 23:11:08 +0000 (00:11 +0100)]
gdk/surface: Allow inhibit layout from backend

If compute_size() returns TRUE, the layout will not be propagated to
GTK. This will be used by the X11 backend to queue asynchronous resizes
that shouldn't yet allocate in GTK.

5 years agox11: Use resize counting for freezing updates too
Jonas Ådahl [Fri, 4 Dec 2020 23:07:21 +0000 (00:07 +0100)]
x11: Use resize counting for freezing updates too

It's already keep strack of when we're waiting for configure events, so
lets reuse it. This fixes an issue where reshown dialogs wouldn't
reappear.

5 years agowayland/surface: Reset last sent min/max size when hiding
Jonas Ådahl [Fri, 4 Dec 2020 17:39:22 +0000 (18:39 +0100)]
wayland/surface: Reset last sent min/max size when hiding

As with the window geometry, the last sent min/max values must be reset
so they are sent again next time the surface is shown.

5 years agowayland/surface: Clear shadow width when hiding
Jonas Ådahl [Fri, 4 Dec 2020 17:35:01 +0000 (18:35 +0100)]
wayland/surface: Clear shadow width when hiding

Not doing this means the next time the same surface is shown, if the
shadow size wasn't changed, it wouldn't be sent to the compositor, which
then would result in compositor deriving its own window geometry which
would include the shadow margin.

This fixes an issue where the file chooser dialog would grow each time
it opened.

5 years agox11/surface: Compute toplevel size outside of frame dispatch
Jonas Ådahl [Fri, 4 Dec 2020 14:40:53 +0000 (15:40 +0100)]
x11/surface: Compute toplevel size outside of frame dispatch

We can't compute and resize a toplevel size during dispatch, as resizing
on X11 is an asynhronous operation, requiring a configuration event.

5 years agotests/animated-resizing: Don't try to resize during frame dispatch
Jonas Ådahl [Fri, 4 Dec 2020 14:02:59 +0000 (15:02 +0100)]
tests/animated-resizing: Don't try to resize during frame dispatch

This will not work on X11 because it's too late to resize, due to
resizing being asynchronous i.e. it won't be complete before we need to
draw.

5 years agogtk/native: Remove gtk_native_check_resize()
Jonas Ådahl [Fri, 4 Dec 2020 10:18:09 +0000 (11:18 +0100)]
gtk/native: Remove gtk_native_check_resize()

This is now handle by the corresponding implemenatations using per
non-gobject-type API.

5 years agogtk/dragicon: Use private gtk_drag_icon_present() instead of GtkNative
Jonas Ådahl [Fri, 4 Dec 2020 10:11:05 +0000 (11:11 +0100)]
gtk/dragicon: Use private gtk_drag_icon_present() instead of GtkNative

It didn't even use GtkNative, just the vfunc it set to the interface
sturct.

5 years agogtk/tooltipwindow: Use gtk_tooltip_window_present() instead of GtkNative
Jonas Ådahl [Fri, 4 Dec 2020 10:06:25 +0000 (11:06 +0100)]
gtk/tooltipwindow: Use gtk_tooltip_window_present() instead of GtkNative

5 years agogtk/texthandle: Use gtk_text_handle_present() instead of GtkNative
Jonas Ådahl [Fri, 4 Dec 2020 09:53:16 +0000 (10:53 +0100)]
gtk/texthandle: Use gtk_text_handle_present() instead of GtkNative

5 years agogtk/window: Don't go via GtkNative when presenting
Jonas Ådahl [Fri, 4 Dec 2020 08:23:46 +0000 (09:23 +0100)]
gtk/window: Don't go via GtkNative when presenting

It'll only call directly back into GtkWindow's toplevel present handling
code.

5 years agogtk/popover: Use gtk_popover_present() instead of going via GtkNative
Jonas Ådahl [Fri, 4 Dec 2020 08:20:50 +0000 (09:20 +0100)]
gtk/popover: Use gtk_popover_present() instead of going via GtkNative

This makes it more explicit that managers of popovers make it "present".

5 years agogtk/entry: Remove emoji chooser field
Jonas Ådahl [Fri, 4 Dec 2020 08:15:53 +0000 (09:15 +0100)]
gtk/entry: Remove emoji chooser field

It wasn't ever set.

5 years agogtk/popover: Request fake motion events for popovers too
Jonas Ådahl [Fri, 4 Dec 2020 08:12:22 +0000 (09:12 +0100)]
gtk/popover: Request fake motion events for popovers too

As with GtkWindow, we need to request fake motion events if allocation
changes, to emulate motion events given the new layout.

5 years agogdk/surface: Emit layout event while frozen
Jonas Ådahl [Fri, 4 Dec 2020 07:04:58 +0000 (08:04 +0100)]
gdk/surface: Emit layout event while frozen

The allocation of popups are part dependent of the allocation of the
root, which means the root must still be allocated when updates are
frozen, otherwise we'll try to allocate non-laid out popups.

5 years agogdk/popup: Remove the popup-layout-changed signal
Jonas Ådahl [Thu, 3 Dec 2020 22:20:31 +0000 (23:20 +0100)]
gdk/popup: Remove the popup-layout-changed signal

It was replaced with GdkSurface::layout.

5 years agogtk/window: Only fake motion events on windows with pending allocations
Jonas Ådahl [Thu, 3 Dec 2020 21:50:31 +0000 (22:50 +0100)]
gtk/window: Only fake motion events on windows with pending allocations

This fixes an issue where the focus of the window continuously received
fake motion events even when a popover was open, making input events end
up behind the popover.

It also adds a comment describing why motion events are requested. Note
that popovers won't work with this, and it's possible both in the past
and now that sporadic missplaced motion events will appear, e.g. when a
window changes allocation but a popover is open.

5 years agogdk/toplevelsize: Rename 'margin' to 'shadow' and 'shadow_width'
Jonas Ådahl [Wed, 2 Dec 2020 16:08:43 +0000 (17:08 +0100)]
gdk/toplevelsize: Rename 'margin' to 'shadow' and 'shadow_width'

This makes it more consistent with everywhere else.

5 years agogdk: Remove GdkSurface::size-changed
Jonas Ådahl [Wed, 2 Dec 2020 16:08:07 +0000 (17:08 +0100)]
gdk: Remove GdkSurface::size-changed

It's not emitted, and everyone should use the GdkSurface::layout signal
from now on.

5 years agogtk/window: Minor cleanup
Jonas Ådahl [Wed, 2 Dec 2020 15:44:59 +0000 (16:44 +0100)]
gtk/window: Minor cleanup

5 years agogtk/window: Remove out-dated comment
Jonas Ådahl [Wed, 2 Dec 2020 15:44:49 +0000 (16:44 +0100)]
gtk/window: Remove out-dated comment

5 years agogtk/window: Use default size if non-resizable if set
Jonas Ådahl [Wed, 2 Dec 2020 15:44:25 +0000 (16:44 +0100)]
gtk/window: Use default size if non-resizable if set

5 years agogdk: Replace all GDK_CONFIGURE usage with GdkSurface::layout
Jonas Ådahl [Wed, 2 Dec 2020 14:29:54 +0000 (15:29 +0100)]
gdk: Replace all GDK_CONFIGURE usage with GdkSurface::layout

This removes the GDK_CONFIGURE event and all related functions and data
types; it includes untested changes to the MacOSX, Win32 and Broadway
backends.

5 years agomacos: we only need 24-bit for color
Christian Hergert [Mon, 7 Dec 2020 19:27:11 +0000 (11:27 -0800)]
macos: we only need 24-bit for color

5 years agoMerge branch 'ebassi/activate-signal' into 'master'
Emmanuele Bassi [Mon, 7 Dec 2020 15:23:55 +0000 (15:23 +0000)]
Merge branch 'ebassi/activate-signal' into 'master'

Add accessors for GtkWidgetClass.activate_signal

See merge request GNOME/gtk!2925

5 years agoAdwaita: no 3d shadow for pressed sidebar
Jakub Steiner [Mon, 7 Dec 2020 13:19:24 +0000 (14:19 +0100)]
Adwaita: no 3d shadow for pressed sidebar

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3413

5 years agoRevert "Adwaita: avoid clipping menu shadows"
Jakub Steiner [Mon, 7 Dec 2020 09:58:12 +0000 (10:58 +0100)]
Revert "Adwaita: avoid clipping menu shadows"

While the workaround hides majority of the issue there are still two big downsides:

  - shadow does eat from the widget dimensions so alignment is broken
  - situations like popover going upwards on screen edge break completely

The appropriate action is to revert these theme duct tape solutions to make room
for a proper fix.

This reverts commit b3dba1dca66d380d1cfafbe92b36d7854b3f4244.

Issue https://gitlab.gnome.org/GNOME/gtk/-/issues/1987

5 years agogdk: Always get shadow width via GdkToplevelSize
Jonas Ådahl [Wed, 2 Dec 2020 13:58:45 +0000 (14:58 +0100)]
gdk: Always get shadow width via GdkToplevelSize

This removes the gdk_surface_set_shadow_width() function and related
vfuncs. The point here is that the shadow width and surface size can now
be communicated to GDK atomically, meaning it's possible to avoid
intermediate stages where the surface size includes the shadow, but
without the shadow width set, or the other way around.

5 years agowayland: Stop emitting size-changed
Jonas Ådahl [Wed, 2 Dec 2020 13:13:32 +0000 (14:13 +0100)]
wayland: Stop emitting size-changed

It's dealt with by GdkSurface::layout now.

5 years agogtk: Allocate everything from GtkNativeClass::layout
Jonas Ådahl [Wed, 2 Dec 2020 10:59:23 +0000 (11:59 +0100)]
gtk: Allocate everything from GtkNativeClass::layout

This changes allocation of the widget trees to happen as a side effect
to the GdkSurface::layout signal, which first passes the GtkNative
instance where it is then forwarded to the implementations of the
GtkNative interface.

The implementations of GtkNative are the ones doing the actual
gtk_widget_allocate(), and they do so in their GtkNativeClass::layout
function.

5 years agogtk/window: Only deal with shadow when (ex|in)cluding csd size
Jonas Ådahl [Wed, 2 Dec 2020 16:42:42 +0000 (17:42 +0100)]
gtk/window: Only deal with shadow when (ex|in)cluding csd size

The size should correspond what gtk_widget_measure() does, and it
measures what's within the window excluding the shadow; so make this
helper function correspond to this.

5 years agogdk/wayland: Always compute-size if GTK asked fer layout
Jonas Ådahl [Wed, 2 Dec 2020 10:50:55 +0000 (11:50 +0100)]
gdk/wayland: Always compute-size if GTK asked fer layout